package com.speak.sparkadminserver.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.speak.sparkadminserver.domain.NutUser;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @version 1.0
 * @Author Xing
 * @Date 2023/2/17 20:15
 */
@Mapper
public interface NutUserDao extends BaseMapper<NutUser> {
    @Select("SELECT * FROM nut_user WHERE id != 1 and del_flag != 1;")
    public List<NutUser> getAll();
    @Select("SELECT * FROM nut_user WHERE username = #{username} and  del_flag != 1")
    public NutUser getUser(@Param("username") String username);
    @Select("SELECT * FROM nut_user WHERE username = #{username} and del_flag != 1")
    public List<NutUser> getUsersNumber(@Param("username") String username);
    @Select("SELECT id FROM nut_user WHERE username = #{username} and del_flag != 1")
    public Long getId(@Param("username") String username);
    @Select("SELECT id FROM nut_user WHERE id = #{id} and del_flag != 1")
    public NutUser getUserById(@Param("id") Long id);

}
